#include <iostream>
using namespace std;

const int N = 31;
int n;
int a[N][N];
int main()
{
    cin >> n;
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < n; j++)
        {
            a[i][0] = 1;
            a[i][i] = 1;
            if (i > 1 && j > 0)
                a[i][j] = a[i - 1][j] + a[i - 1][j - 1];
        }
    }

    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j <= i; j++)
        {
            printf("%5d", a[i][j]);
        }
        printf("\n");
    }
}